<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="/templates/homeGerente.xhtml">
	<ui:define name="corpo">
		<h:form id="formCad">
			<div align="center">
				<h:panelGrid columns="1" >
					<div class="user" align="center">
						<p:panelGrid columns="2">
							<h:outputLabel value="Nome:" />
							<p:inputText value="#{estabelecimentoMB.entity.nome}" />
						</p:panelGrid>
						
						<p:panelGrid columns="3">
							<h:outputLabel value="Nome:" />
							<p:inputText id="nome" value="#{estabelecimentoMB.entity.nome}" >
								<f:validateLength minimum="3" />
							</p:inputText>
							<p:message for="nome"  display="icon" />
						</p:panelGrid>
						
						
						<p:panelGrid columns="2">
							<h:outputLabel value="CNPJ:" />
							<p:inputMask value="#{estabelecimentoMB.entity.cnpj}" mask="999.999.999-99"/>
						</p:panelGrid>
						<p:panelGrid columns="2">
							<h:outputLabel value="Possui Entrega:" />
							<p:selectOneRadio
								value="#{estabelecimentoMB.entity.sePossuiEntrega}">
								<f:selectItem itemLabel="Sim" itemValue="S" />
								<f:selectItem itemLabel="Não" itemValue="N" />
							</p:selectOneRadio>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="CPF :" />
							<p:inputMask value="#{estabelecimentoMB.gerente.cpf}" mask="999.999.999-99"/>
						</p:panelGrid>
						<p:panelGrid columns="2">
							<h:outputLabel value="Nome Gerente:" />
							<p:inputText id="nome" value="#{estabelecimentoMB.gerente.nome}" >
								<f:validateLength minimum="3" maximum="20" />
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="Email:" />
							<p:inputText value="#{estabelecimentoMB.gerente.email}" />
						</p:panelGrid>
					</div>
					<p:commandButton value="Salvar"
						action="#{estabelecimentoMB.saveOrUpdate}" ajax="false" />
				</h:panelGrid>
		
			</div>
		</h:form>
	</ui:define>
</ui:composition>
</html>